const app = getApp()
Page({
  data: {
    notifyList: []
  },
  onLoad() {
    this.getNotifyList()
  },
  async getNotifyList() {
    const {
      code,
      data: notifyList
    } = await wx.http.get('/announcement')
    // 判错处理
    if (code !== 10000) return wx.utils.toast()
    // 设置到 data 中，最好执行下初始值
    this.setData({
      notifyList
    })
  }
})